<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>病虫害数据管理 | 注册</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" th:href="@{/plugin/AdminLTE/bootstrap/css/bootstrap.min.css}" href="../static/plugin/AdminLTE/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
    <link rel="stylesheet" th:href="@{/plugin/AdminLTE/dist/css/AdminLTE.min.css}" href="../static/plugin/AdminLTE/dist/css/AdminLTE.min.css">
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body class="hold-transition login-page" th:style="'background:url(' + @{'/img/' + ${app.name} + '.jpg'} + ');'">
<div class="login-box">
    <div class="login-logo">
        <a href="#"><b>病虫害数据管理系统</b></a>
    </div>
    <div class="register-box-body" style="border: solid">
        <p class="login-box-msg">新用户注册</p>
        <form th:action="@{/register}" th:object="${user}" th:method="post" method="post" role="form" action="/register">
            <div class="form-group has-feedback" th:with="hasError=${#fields.hasErrors('userName')}"  th:classappend="${hasError} ? 'has-error'">
                <label class="control-label" for="userName">用户名</label>
                <input type="text" class="form-control" id="userName" th:field="*{userName}"
                       data-container="body" data-toggle="popover" data-trigger="focus" data-placement="left" data-content="3到20位,填写字母和数字">
                <span class="glyphicon glyphicon-user form-control-feedback"></span>
                <span class="help-block" th:if="${hasError}" th:errors="*{userName}"></span>
            </div>
            <div class="form-group has-feedback" th:with="hasError=${#fields.hasErrors('password')}"  th:classappend="${hasError} ? 'has-error'">
                <label class="control-label" for="password">密码</label>
                <input type="password" class="form-control" id="password" th:field="*{password}"
                       data-container="body" data-toggle="popover" data-trigger="focus" data-placement="left" data-content="6到20位,字母数字组合">
                <span class="glyphicon glyphicon-lock form-control-feedback"></span>
                <span class="help-block" th:if="${hasError}" th:errors="*{password}"></span>
            </div>
            <div class="form-group has-feedback" th:with="hasError=${#fields.hasErrors('confirmPassword')}"  th:classappend="${hasError} ? 'has-error'">
                <label class="control-label" for="confirmPassword">密码确认</label>
                <input type="password" class="form-control" id="confirmPassword" th:field="*{confirmPassword}">
                <span class="glyphicon glyphicon-log-in form-control-feedback"></span>
                <span class="help-block" th:if="${hasError}" th:errors="*{confirmPassword}"></span>
            </div>
            <div class="row">
                <div class="col-xs-8">
                    <a th:href="@{/login}" href="login.html" class="text-center">已有账号</a>
                </div>
                <div class="col-xs-4">
                    <button type="submit" class="btn btn-primary btn-block btn-flat">注册</button>
                </div>
            </div>
        </form>
    </div>
</div>
<script th:src="@{/plugin/AdminLTE/plugins/jQuery/jquery-2.2.3.min.js}" src="../static/plugin/AdminLTE/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script th:src="@{/plugin/AdminLTE/bootstrap/js/bootstrap.min.js}" src="../static/plugin/AdminLTE/bootstrap/js/bootstrap.min.js"></script>
<script th:src="@{/plugin/AdminLTE/dist/js/app.min.js}" src="../static/plugin/AdminLTE/dist/js/app.min.js"></script>
<script>
    $(document).ready(function () {
        $('[data-toggle="popover"]').popover();
    });
</script>
</body>
</html>
